﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;


namespace TV4Home.MvcWebInterface.UI.Controllers
{
    public class MovieLibraryController : Controller
    {  

        public ActionResult Index()
        {
            var movieList = WebService.GmaWebService.ServiceInstance.MP_GetAllMovies();
            return View(movieList);
        }

        public ActionResult Details(int movie)
        {
            var fullMovie = WebService.GmaWebService.ServiceInstance.MP_GetFullMovie(movie);
            return View(fullMovie);

        }

        public ActionResult Image(int movie)
        {
            byte[] image = System.IO.File.ReadAllBytes(WebService.GmaWebService.ServiceInstance.MP_GetFullMovie(movie).CoverPath);
            return File(image, "image/jpg");
        }
        //public ActionResult Play(int movie)
        //{

        //    var fullMovie = service.MP_GetFullMovie(movie).Filename

        //}
    }
}
